package com.danicsoft.daide.command;

import com.danicsoft.daide.token.TokenGroup;
import com.danicsoft.daide.token.TokenMap.Commands;

/**
 * Implements the GOF command. From Eric Wald's <a
 * href="http://pydip.brainshell.org/docs/syntax.html">protocol specification</a>,
 * v0.14:
 * <h4><a name="GOF">client_command = NOT (GOF)</a></h4>
 * <p>
 * This is sent by the player to the server. It tells the server not to process
 * orders until the deadline. It is the equivalent of set wait on the judges.
 * The server will reply with <b>YES (NOT (GOF))</b>, or <b>REJ (NOT (GOF))</b>
 * if the game has not started, the power has been eliminated, or the game has
 * ended.
 * </p>
 * <h4>client_command = GOF</h4>
 * <p>
 * Go ahead and process orders when everybody is in. The server will reply with
 * <b>REJ (GOF)</b> if the game has not started or has ended, or <b>YES (GOF)</b>
 * if everything is okay. It will immediately follow this with <b>MIS (...)</b>
 * (as when an incomplete set of orders is submitted &mdash; <a href="#SUB">see
 * <b>SUB</b></a>) if not all orders are in for this player.
 * </p>
 * <p>
 * If the player does not send <b>GOF</b> or <b>NOT (GOF)</b> during a turn,
 * the server will assume it is ready to process as soon as it has received a
 * complete set of orders. (That is, <b>GOF</b> is assumed each turn.)
 * </p>
 * 
 * @author Daniel Yule (daniel.yule@gmail.com)
 * @version 1.0
 * @see NotCommand
 */
public class GoFlagCommand extends Command {

	/**
	 * Construct a new <code>GoFlagCommand</code> from the tokens given.
	 * @param tokens The tokens to construct this from.  It should be empty.
	 * @throws ParseException Never.
	 */
	public GoFlagCommand(TokenGroup tokens) throws ParseException {
		super(tokens);
	}

	/**
	 * Construct a new GoFlagCommand to send to the server.
	 *
	 */
	public GoFlagCommand() {}

	@Override
	public byte getType() {
		return Commands.GOF;
	}

	@Override
	public String toString() {
		return "Ready to process";
	}

	public void doIO(TokenIO tokenIO, TokenGroup tokens) throws ParseException {

	}

}
